package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class ReturnValue {

    private int beginIndex;
    private int endIndex;
    private ValueExpression valueExpression;

    public ReturnValue(ValueExpression valueExpression) {
        this.beginIndex = valueExpression.getBeginIndex();
        this.endIndex = valueExpression.getEndIndex();
        this.valueExpression = valueExpression;
    }

    public ReturnValue(int beginIndex, int endIndex) {
        this.beginIndex = beginIndex;
        this.endIndex = endIndex;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public ValueExpression getValueExpression() {
        return valueExpression;
    }

    public boolean isNull() {
        return valueExpression == null;
    }

}
